include ../.env
export $(shell sed 's/=.*//' ../.env)
# Use hadoop as base image
HADOOP_IMAGE_NAME=${IMAGE_REPO}/hadoop-devel:${HADOOP_VERSION}

# HBase
HBASE_IMAGE_NAME=${IMAGE_REPO}/hbase-devel:${HBASE_VERSION}
DOCKERFILE=Dockerfile
PUSH=false

hbase:
	cd ./build && docker build -t ${HBASE_IMAGE_NAME}  \
	--build-arg HBASE_VERSION=${HBASE_VERSION} \
	--build-arg HADOOP_VERSION=${HADOOP_VERSION} \
	--build-arg CENTOS_VERSION=${CENTOS_VERSION}  \
	--build-arg IMAGE_REPO=${IMAGE_REPO}  \
	-f ${DOCKERFILE} .
ifeq (${PUSH},true)
	docker push ${HBASE_IMAGE_NAME}
endif

.PHONY: compose
compose:
	cd compose && docker compose up -d

.PHONY: compose-clean
compose-clean:
	cd compose && docker compose down